package base;

public class Math {
	
	public static double[] somar2Vetores(double [] v1, double [] v2){
		double [] novoVetor = new double[v1.length];

		for (int i = 0; i < v1.length; i++) {
			novoVetor[i] = v1[i] + v2[i];
		}

		return novoVetor;
	}
	
	public static double[] somar3Vetores(double [] v1, double [] v2, double [] v3){
		double [] novoVetor = new double[v1.length];

		for (int i = 0; i < v1.length; i++) {
			novoVetor[i] = v1[i] + v2[i] + v3[i];
		}

		return novoVetor;
	}

	public static double[] subtrair2Vetores(double [] v1, double [] v2){
		double [] novoVetor = new double[v1.length];

		for (int i = 0; i < v1.length; i++) {
			novoVetor[i] = v1[i] - v2[i];
		}

		return novoVetor;
	}

	public static double[] multiplicarNumeroPorVetor(double num, double [] v1){
		double [] novoVetor = new double[v1.length];

		for (int i = 0; i < v1.length; i++) {
			novoVetor[i] = v1[i] * num;
		}

		return novoVetor;
	}
}
